<!--
  - Copyright (c) 2021.  北京维数科技有限公司
  - Date :  2021/3/25
  - Author ：F12 Console=> atob("MzMxNDkxODAwQHFxLmNvbQ==")
  - Version ：1.0.0
  -->

<template>
  <div><div class="abstatic-height"></div>
    <div class="app-container calendar-list-container">
        <el-row>
            <el-tabs v-model="activeName" @tab-click="handleClick" type="card">
                <el-tab-pane v-for="(item,index) in changeTabs" :key="index" :label="item.label" :name="item.name" :lazy='true'>
                  <component :is=item.content></component>
                </el-tab-pane>
            </el-tabs>
        </el-row>
    </div>
  </div>
</template>

<script>
import deviceType from "./components/deviceType";
// import measuringWarn from "./components/measuringWarn";
import sensorType from "./components/sensorType";
import warningNotice from "./components/warningNotice";
import tenetConfig from "./components/tenetConfig";
import pushRules from "./components/pushRules";
import rulseLog from "./components/rulesLog";
export default {
  name: "devicesysConfig",
  data() {
    return {
      changeTabs:[{
         label:'传感器类型',
         content:sensorType,
         name:'sensorType'
      },{
          label:'网关设备类型',
         content:deviceType,
         name:'deviceType'
      },
      //   {
      //    label:'测点配置',
      //    content:measuringWarn,
      //    name:'measuringWarn'
      // },
        {
          label:'报警通知',
         content:warningNotice,
         name:'warningNotice'
      },{
          label:'站点设置',
         content:tenetConfig,
         name:'tenetConfig'
      },
        {
          label:'推送规则',
          content:pushRules,
          name:'pushRules'
        },
        {
          label:'推送日志',
          content:rulseLog,
          name:'rulseLog'
        }],
      activeName:'sensorType'
    };
  },
  created(){
     if (sessionStorage.getItem('backlist')){
       this.activeName = 'pushRules'
     }
  },
  beforeRouteLeave(to,from,next){
    if(sessionStorage.getItem('backlist')){
      sessionStorage.removeItem('backlist')
    }
    next()
  },
  methods: {
    handleClick() {
      sessionStorage.removeItem('backlist')
    }
  }
};
</script>
